package com.rzn.reading.service;

import com.rzn.reading.entity.Attach;
import com.baomidou.mybatisplus.extension.service.IService;
import com.rzn.reading.model.dto.AttachResultDTO;
import com.rzn.reading.model.param.UploadParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 附件表 服务类
 * </p>
 *
 * @author rzn
 * @since 2022-02-12
 */
public interface AttachService  {
    AttachResultDTO upload(MultipartFile file,String ownerName, int ownerId,String category) throws IOException;

    List<AttachResultDTO> uploadBatch(MultipartFile[] files);

    int relateAttach(Integer ownerId, String ownerName,List<Integer> ids);

    List<Attach> findByOwner(Integer ownerId, String ownerName, String category);

    int removeByOwner(Integer ownerId, String ownerName, String category);

    List<String> getUrls(String ownerName, Integer ownerId);

    boolean removeById(Integer id);
}
